package Designpatterns.shizhan.calculator.impl;

import Designpatterns.shizhan.calculator.Algorithm;

public class ModuloOperation implements Algorithm {

    @Override
    public Integer compute(Integer number1, Integer number2) {
        if (number2!=0){
            int i = number1 % number2;
            return i;
        }else {
            throw new IllegalArgumentException("余数不能为0");
        }
    }
}
